<?php
session_start(); 
include_once "config.php";
include_once "connect.php";

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', true);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>AP3-SP-les phoques du desert</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="verification.js"></script>	
</head>
<body onLoad="display_c()">

	<script src="jquery.js"></script>
	<div id="all">
		<div id="header">		
		<?php
		$array=array();
		include_once "sujet.php";
		$titre=mysql_query("select * from AP3_SP_rubrique where id_rubrique='".$_GET["id"]."'");
		while($t=mysql_fetch_assoc($titre))
		{
		
		echo "<h1>".$t["libelle_rubrique"]."</h1>";
		$array[]=$t["id_rubrique"];
		}
	
		?>
			
		</div>
		
		<div id="content">
		<?php
		$post=mysql_query("select * from AP3_SP_user");
		$post2=mysql_query("select id_type from AP3_SP_user where pseudo=\"".$_SESSION["user"]."\"") or die(mysql_error());
			$p2=mysql_fetch_assoc($post2);
			foreach($p2 as $res)
			{	
			}
		$i=0;
		if(3==$res)
		{
			//while($t=mysql_fetch_assoc($titre))
			//{
				//if($t["id_rubrique"]==22 || $t["id_rubrique"]==23)
				//{
					while($row=mysql_fetch_assoc($post))
					{
						echo "<ul>";
						if($row["id_type"]!=$res)
						{
							if($array[$i]==22 )
							{

								echo "<li> pseudo : ".$row["pseudo"]."<br/>";
								echo "id : ".$row["id_user"]."<br/>";
								echo "nom : ".$row["nom"]."<br/>";
								echo "prenom : ".$row["prenom"]."</li><br/>";
								echo "<a href='modifie_compte.php?id_user=".$row["id_user"]."'>	Faire de ce membre un admin </a><br/>"; //lien modifier compte
								echo "<br/>";
							}
						}
						if($row["id_type"]!=$res)
						{
							if($array[$i]==23 )
							{

								echo "<li> pseudo : ".$row["pseudo"]."<br/>";
								echo "id : ".$row["id_user"]."<br/>";
								echo "nom : ".$row["nom"]."<br/>";
								echo "prenom : ".$row["prenom"]."</li><br/>";
								echo "<a href='delete_compte.php?id_user=".$row["id_user"]." '>Supprimer ce compte </a><br/>"; //lien supprime compte
								echo "<br/>";
							}
						}
						if($row["id_type"]!=$res)
						{
							if($array[$i]==24 )
							{

								
								echo "<a href='creer_admin.php?id_user=".$row["id_user"]." '>Créer un admin </a><br/>"; //lien pour créer un administrateur

							}
						}
						echo "</ul>";
					}
				//}
			//}
		}
		
		echo "<a href='index.php'>Retour à l'index</a>";
		
		
		?>
				</div>
		
		<div id="footer">
			<div id="ct">
			
			</div>
			
			<div id="droit">
			Made by Les Phoques Du Désert
			</div>
		</div>
	</div>
	

	

</body>
</html>